package com.distribution.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.distribution.system.domain.bo.RefreshOrderBO;
import com.distribution.system.domain.dto.CmccDaOrderListDTO;
import com.distribution.system.domain.dto.OrderStateDTO;
import com.distribution.system.domain.entity.CmccDaOrder;
import com.distribution.system.domain.entity.CmccDaUpChannelInfo;
import com.distribution.system.domain.req.CmccDaOrderListReq;
import com.distribution.system.domain.vo.LineChartDataVO;
import com.distribution.system.domain.vo.OrderListCountVO;
import com.distribution.system.enums.OrderStatusEnum;
import com.distribution.system.enums.ProfitConditionStatusEnum;

import java.util.List;

/**
 * @author Liping Huo
 * @date 2023/5/22 21:50
 */
public interface CmccDaOrderService extends IService<CmccDaOrder> {
    /**
    * @Author: GodLu
    * @Date: 2024/8/29 9:52
    * @Description: 根据查询条件获取订单列表
    * @param cmccDaOrderListDTO 查询条件
    * @return: List<CmccDaOrder>
    */
    List<CmccDaOrder> listCmccDaOrder(CmccDaOrderListDTO cmccDaOrderListDTO);
    List<CmccDaOrder> listCmccDaOrderBySearchValue(CmccDaOrderListDTO cmccDaOrderListDTO);

    OrderListCountVO getOrderStatusCount(CmccDaOrderListDTO cmccDaOrderListDTO);
    OrderListCountVO getOrderStatusCountBySearchValue(CmccDaOrderListDTO cmccDaOrderListDTO);



    /** ============================================================ 订单更新相关 ===================================================================== */
    /**
    * @Author: GodLu
    * @Date: 2024/8/29 9:49
    * @Description: 更具订单刷新对象更新订单状态
    * @param refreshOrderBo 订单刷新对象
    * @return: void
    */
    void refreshOrderStatusByRefreshOrderBO(CmccDaOrder cmccDaOrder, RefreshOrderBO refreshOrderBo);
    /**
     * 更新订单刷新 信息
     *
     * @param refreshOrderBo            三方返回的数据对象
     * @param orderStatusEnum           订单状态枚举
     * @param profitConditionStatusEnum 获利条件枚举
     */
    void updateOrderByRefreshOrderBO(RefreshOrderBO refreshOrderBo, OrderStatusEnum orderStatusEnum, ProfitConditionStatusEnum profitConditionStatusEnum);
    void refreshOrder(CmccDaOrder cmccDaOrder);
    void refreshOrderList(List<CmccDaOrder> orderNoList, Integer channelId);
    void updateOrderState(OrderStateDTO orderStateDTO);
    void updateOrderStatusByOrderNo(CmccDaOrder cmccDaOrder);
    void updateOrderInfoByOrderNo(CmccDaOrder cmccDaOrder);
    void refreshChannelCommission(CmccDaUpChannelInfo cmccDaUpChannelInfo);



    /** ============================================================ 统计相关 ===================================================================== */
    LineChartDataVO getTodayOrderCount(CmccDaOrderListReq cmccDaOrderListReq);
    LineChartDataVO getYesterdayOrderCount(CmccDaOrderListReq cmccDaOrderListReq);
    LineChartDataVO getWeekOrderCount(CmccDaOrderListReq cmccDaOrderListReq);
    LineChartDataVO getMonthOrderCount(CmccDaOrderListReq cmccDaOrderListReq);
    LineChartDataVO getCustomOrderCount(CmccDaOrderListReq cmccDaOrderListReq);



    void updateOrderisWriteOff(CmccDaOrder CmccDaOrder);

    int getTodayPlaceSuccessOrderCount(Long userId, List<String> productCodeList);
}
